package com.fm.autoLoad;

import com.fm.mqtt.MqttPushClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2018/8/8 0008.
 */
@Order(value=100)
@Component
public class CommandLineRunnerListenerImpl implements CommandLineRunner {

    @Override
    public void run(String... args) throws Exception {
        // 执行操作
        String topics [] = {"/sys/+/+/thing/#","/+/+/user/#"};
        MqttPushClient.getInstance().unsubscribe(topics);
        MqttPushClient.getInstance().subscribeSome(topics);
    }
}
